package com.example.demo.单例模式;

/**
 * @description:
 * @projectName:demo
 * @see:单例模式
 * @author:袁成龙
 * @createTime:2020/10/7 10:13
 * @version:1.0
 */
public class TestLanHan {

    private static TestLanHan testLanHan;

    public TestLanHan() {
    }

    public static TestLanHan getInstance() {

        if (testLanHan == null) {
            synchronized (TestLanHan.class) {
                if (testLanHan == null) {
                     testLanHan = new TestLanHan();
                    return testLanHan;
                }
            }
        }
return null;
    }

}